<template>
  <view class="page" :style="themeColor">
    <fu-custom :isBack="true" :isBottom="true" bgColor="bg-white">
      <view slot="content">个性化推荐设置</view>
    </fu-custom>
    <!---flex布局flex布局开始-->
    <view class="flex benben-flex-layout flex-wrap align-center personalizedSettings_flex_1" style="margin: 0 24rpx;">
      <view class='flex flex-direction flex-wrap align-stretch flex-sub'>
        <text class='personalizedSettings_fd1_0_c0'>个性化内容推荐</text>
        <text class='personalizedSettings_fd1_0_c1'>关闭后无法收到个性化内容推荐</text>
      </view>
     <switch :checked="msgPushType==1?true:false" @change="changePush" color="#4dc777" />
    </view>
    <!---flex布局flex布局结束-->


  </view>
</template>
<script>
  export default {
    components: {},


    data() {
      return {
        msgPushType:false
      };
    },
    computed: {
      themeColor() {
        return this.$store.getters.themeColor
      },

    },
    watch: {},
    onLoad(options) {
			this.msgPushType = uni.getStorageSync('msgPushTypeSync');
    },
    onUnload() {

    },
    onReady() {

    },
    onShow() {

    },
    onHide() {

    },
    onResize() {

    },
    onPullDownRefresh() {

    },
    onReachBottom(e) {

    },
    onPageScroll(e) {

    },
    methods: {
      
      //设置推送
      changePush(e) {
      	console.log(e.detail.value);
      	this.msgPushType = e.detail.value ? 1 : 0;
      	uni.setStorageSync('msgPushTypeSync', this.msgPushType);
      },

    }
  };
</script>
<style lang="scss" scoped>
  .page {
    width: 100vw;
    overflow-x: hidden;
    min-height: calc(100vh - var(--window-bottom));
    background: #F8F8F8;
    background-size: 100% auto !important;
  }

  .personalizedSettings_flex_0 {
    border-bottom: 1px solid #eee;
    background: #fff;
    width: 750rpx;
    height: 88rpx;
    overflow: hidden;
    z-index: 10;
    top: 0rpx;
    background-size: 100% auto !important;
  }

  .personalizedSettings_fd0_0_c2 {
    padding: 0rpx 0rpx 0rpx 0rpx;
    width: 100rpx;
  }

  .personalizedSettings_fd0_0_c1_c0 {
    font-size: 36rpx;
    font-weight: 500;
    color: #333333;
    line-height: 50rpx;
  }

  .personalizedSettings_fd0_0_c0_c0 {
    font-size: 36rpx;
    font-weight: 400;
    color: #333;
  }

  .personalizedSettings_fd0_0_c0 {
    width: 100rpx;
  }

  .personalizedSettings_fd0_0 {
    padding: 0rpx 32rpx 0rpx 32rpx;
    line-height: 88rpx;
  }

  .personalizedSettings_flex_1 {
    background: #fff;
    background-size: 100% auto !important;
    border-radius: 16rpx 16rpx 16rpx 16rpx;
    padding: 32rpx 32rpx 32rpx 32rpx;
    margin: 16rpx 0rpx 0rpx 0rpx;
  }

  .personalizedSettings_fd1_1 {
    width: 72rpx;
    height: 32rpx;
  }

  .personalizedSettings_fd1_0_c1 {
    color: #BBBBBB;
    font-size: 24rpx;
    font-weight: 400;
    line-height: 30rpx;
  }

  .personalizedSettings_fd1_0_c0 {
    color: #2A2A2A;
    font-size: 32rpx;
    font-weight: 700;
    line-height: 42rpx;
    margin: 0rpx 0rpx 16rpx 0rpx;
  }
</style>
